function a() {
  return new Promise((resolve, reject) => {
    setTimeout(() => {
      console.log('a');
      // reject('no')
      resolve('ok')
      
    }, 1000)
  })
  
}

function b() {
  return new Promise((resolve, reject) => {
    setTimeout(() => {
      console.log('b');
      resolve('yes')
    }, 500)
  });
}

Promise.race([a(), b()]).then((res) => {
  console.log(res);
})


// b()

